;(function(){
    var suportEvent="onrientationchange" in window?"orientationchange":"resize";
    function debounce(fn,event,delay){
        var delay=delay||300;
        var timer=null;
        return function(e){
            timer&&clearTimeout(timer);
            timer=setTimeout(()=>{
                fn();
            },delay);
        }
    }
    function setRem(){
        var clientW=document.documentElement.offsetWidth;
        var fontSize=100/375*clientW;
        document.documentElement.style.fontSize=fontSize+"px";
    }
    window.onload=setRem;
    window.addEventListener(suportEvent, debounce(setRem));
})();